package sk.fiit.lulco.gui;

import java.util.Random;

public class Settings {
	private static int generationsCount = 100;
	private static int individualsInGeneration = 50;
	private static int eliteCount = 5;
	private static int newGenerationIndividuals = 45;
	private static int timeToLive = 3;
	private static int maxPreviousColorsSize = 2;
	private static double conflictedVerticesMutationProbability = 0.90;
	private static double nonConflictedVerticesMutationProbability = 0.10;
	private static String filename;
	private static boolean created = false;
	private static boolean gui = false;

	public static int getGenerationsCount() {
		return generationsCount;
	}
	
	public static void setGenerationsCount(int generationsCount) {
		Settings.generationsCount = generationsCount;
	}
	
	public static int getIndividualsInGeneration() {
		return individualsInGeneration;
	}
	
	public static void setIndividualsInGeneration(int individualsInGeneration) {
		Settings.individualsInGeneration = individualsInGeneration;
	}

	public static int getEliteCount() {
		return eliteCount;
	}
	
	public static void setEliteCount(int eliteCount) {
		Settings.eliteCount = eliteCount;
	}

	public static int getNewGenerationIndividuals() {
		return newGenerationIndividuals;
	}
	
	public static void setNewGenerationIndividuals(int newGenerationIndividuals) {
		Settings.newGenerationIndividuals = newGenerationIndividuals;
	}

	public static int getTimeToLive() {
		return timeToLive;
	}
	
	public static void setTimeToLive(int timeToLive) {
		Settings.timeToLive = timeToLive;
	}
	
	public static int getMaxPreviousColorsSize() {
		return maxPreviousColorsSize;
	}
	
	public static void setMaxPreviousColorsSize(int maxPreviousColorsSize) {
		Settings.maxPreviousColorsSize = maxPreviousColorsSize;
	}
	
	public static double getConflictedVerticesMutationProbability() {
		return conflictedVerticesMutationProbability;
	}
	
	public static void setConflictedVerticesMutationProbability(
			double conflictedVerticesMutationProbability) {
		Settings.conflictedVerticesMutationProbability = conflictedVerticesMutationProbability;
	}
	
	public static double getNonConflictedVerticesMutationProbability() {
		return nonConflictedVerticesMutationProbability;
	}
	
	public static void setNonConflictedVerticesMutationProbability(
			double nonConflictedVerticesMutationProbability) {
		Settings.nonConflictedVerticesMutationProbability = nonConflictedVerticesMutationProbability;
	}

	public static String getFilename() {
		if (created == false) {
			Random random = new Random();
			filename = "logs/stats" + random.nextInt(1000000) + ".csv";
			created = true;
		}
		return filename;
	}
	
	public static void setCreated(boolean created) {
		Settings.created = created;
	}

	public static boolean getCreated() {
		return created;
	}
	
	public static void setGui(boolean gui) {
		Settings.gui = gui;
	}
	
	public static boolean getGui() {
		return gui;
	}
}
